﻿<Window x:Class="MDSAdministration.MainWindow"
        xmlns:local="clr-namespace:MDSAdministration"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:wpg="clr-namespace:WPG;assembly=WPG"
        Title="MDS Administration"
        Height="535"
        Width="863"
        Loaded="Window_Loaded">
    <Window.Resources>
        <Style x:Key="SliderStyle"
               TargetType="GridSplitter">
            <Setter Property="Background"
                    Value="#9B6495ED" />
        </Style>
        <local:ExcelUploadToolTipCellConverter x:Key="colourHighlighterCellConverter" />
        <local:ExcelUploadColourHighlighterCellConverter x:Key="toolTipCellConverter" />

        <local:ExcelUploadToolTipHeaderConverter x:Key="colourHighlighterHeaderConverter" />
        <local:ExcelUploadColourHighlighterHeaderConverter x:Key="toolTipHeaderConverter" />
        <local:ResourceWrapper x:Key="resourceWrapper" />

        <HierarchicalDataTemplate DataType="{x:Type local:mdsModel}"
                                  ItemsSource="{Binding Path=Versions}">
            <TextBlock Text="{Binding Path=Description}" />
        </HierarchicalDataTemplate>
        <HierarchicalDataTemplate DataType="{x:Type local:mdsVersion}"
                                  ItemsSource="{Binding Path=Entities}">
            <TextBlock Text="{Binding Path=Description}" />
        </HierarchicalDataTemplate>
        <HierarchicalDataTemplate DataType="{x:Type local:mdsEntity}"
                                  ItemsSource="{Binding Path=Attributes}">
            <TextBlock Text="{Binding Path=Description}" />
        </HierarchicalDataTemplate>
        <HierarchicalDataTemplate DataType="{x:Type local:mdsAttribute}">
            <TextBlock Text="{Binding Path=Description}" />
        </HierarchicalDataTemplate>

        <Style x:Key="GroupHeaderStyle"
               TargetType="{x:Type GroupItem}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type GroupItem}">
                        <Expander x:Name="exp"
                                  IsExpanded="True"
                                  Background="White"
                                  Foreground="Black">
                            <Expander.Header>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Text="{Binding Path=Name}" />
                                    <TextBlock Text="{Binding Path=ItemCount}"
                                               Margin="8,0,4,0" />
                                    <TextBlock Text="Items" />
                                </StackPanel>
                            </Expander.Header>
                            <ItemsPresenter />
                        </Expander>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="27" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Grid Grid.Row="0">
            <Menu IsMainMenu="True"
                  Height="27"
                  VerticalAlignment="Top"
                  HorizontalAlignment="Stretch">
                <MenuItem Header="_Tool">
                    <MenuItem Header="Export"
                              Name="mnuToolExport"
                              Click="mnuToolExport_Click"></MenuItem>
                    <MenuItem Header="Excel Template Gen"
                              Name="mnuToolExcelTemplateGen"
                              Click="mnuToolExcelTemplateGen_Click"></MenuItem>
                </MenuItem>
                <MenuItem Header="_Help">
                    <MenuItem Header="About"
                              Name="mnuHelpAbout"
                              Click="mnuHelpAdd_Click"></MenuItem>
                </MenuItem>

            </Menu>
        </Grid>
        <Grid Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="50" />
                <RowDefinition />
            </Grid.RowDefinitions>
            <TabControl Grid.RowSpan="2">
                <TabItem Header="Model Schema Compare"
                         Name="tbiModelSchemaCompare">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="50" />
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <Grid Grid.Row="0"
                              Grid.ColumnSpan="2">
                            <Button Content="Connect"
                                    Height="23"
                                    HorizontalAlignment="Left"
                                    Margin="6,6,0,0"
                                    Name="btnConnect"
                                    VerticalAlignment="Top"
                                    Width="55"
                                    Click="btnConnect_Click" />
                            <Button Content="Refresh"
                                    Height="23"
                                    Margin="66,6,0,0"
                                    Name="btnDataHelperRefresh"
                                    VerticalAlignment="Top"
                                    Click="btnDataHelperRefresh_Click"
                                    IsEnabled="False"
                                    HorizontalAlignment="Left"
                                    Width="75" />
                            <Button Content="Deploy"
                                    Height="23"
                                    HorizontalAlignment="Left"
                                    IsEnabled="False"
                                    Margin="150,6,0,0"
                                    Name="btnDataHelperDeploy"
                                    VerticalAlignment="Top"
                                    Width="75"
                                    Click="btnDataHelperDeploy_Click" />
                            <Grid Margin="261,0,6,0">
                                <Label Content="Server A"
                                       Height="28"
                                       Margin="0,0,111,0"
                                       HorizontalAlignment="Left"
                                       Name="label5"
                                       VerticalAlignment="Top" />
                                <Label Content="Server B"
                                       Height="28"
                                       Margin="180,0,111,0"
                                       Name="label6"
                                       VerticalAlignment="Top" />
                                <TextBlock Name="tbSCServerA"
                                           Margin="239,0,6,22" />
                                <TextBlock Margin="239,22,6,0"
                                           Name="tbSCServerB" />
                                <Image Height="32"
                                       HorizontalAlignment="Left"
                                       Margin="60,6,0,0"
                                       Name="imgSCServerA"
                                       Stretch="UniformToFill"
                                       VerticalAlignment="Top"
                                       Width="30" />
                                <Image Height="32"
                                       HorizontalAlignment="Left"
                                       Margin="100,6,0,0"
                                       Name="imgSCDirection"
                                       Stretch="UniformToFill"
                                       VerticalAlignment="Top"
                                       Width="32"
                                       MouseLeftButtonUp="imgDirection_MouseLeftButtonUp" />
                                <Image Height="32"
                                       Margin="140,6,0,0"
                                       Name="imgSCServerB"
                                       Stretch="UniformToFill"
                                       VerticalAlignment="Top"
                                       HorizontalAlignment="Left"
                                       Width="30" />
                            </Grid>

                        </Grid>
                        <Grid Grid.Row="1"
                              Grid.ColumnSpan="2">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="150" />
                                <ColumnDefinition Width="5" />
                                <ColumnDefinition />
                            </Grid.ColumnDefinitions>
                            <Grid Grid.Column="0">
                                <GroupBox Header="Ignore Entity"
                                          Margin="0,1,6,0"
                                          Name="groupBox2"
                                          Height="134"
                                          VerticalAlignment="Top">
                                    <Grid Height="100">
                                        <CheckBox Content="MUID"
                                                  Height="16"
                                                  HorizontalAlignment="Left"
                                                  IsChecked="{Binding cStates.EntityMUID }"
                                                  Margin="4,4,0,0"
                                                  Name="cbxEntityMUID"
                                                  VerticalAlignment="Top"
                                                  Width="120" ToolTip="Check MUID are the same" />
                                        <CheckBox Content="EntityID"
                                                  Height="16"
                                                  HorizontalAlignment="Left"
                                                  IsChecked="{Binding cStates.EntityID }"
                                                  Margin="4,20,0,0"
                                                  Name="cbxEntityID"
                                                  VerticalAlignment="Top"
                                                  Width="120" ToolTip="Check EntityID are the same. EntityID may change depending on the order the entity was created." />
                                        <CheckBox Content="EntityTable"
                                                  Height="16"
                                                  HorizontalAlignment="Left"
                                                  IsChecked="{Binding cStates.EntityTable }"
                                                  Margin="4,36,0,0"
                                                  Name="cbxEntityTable"
                                                  VerticalAlignment="Top"
                                                  Width="120" ToolTip="Check EntityTable are the same. EntityTable may change depending on the order the entity was created." />
                                        <CheckBox Content="SecurityTable"
                                                  Height="16"
                                                  HorizontalAlignment="Left"
                                                  IsChecked="{Binding cStates.SecurityTable }"
                                                  Margin="4,52,0,0"
                                                  Name="cbxSecurityTable"
                                                  VerticalAlignment="Top"
                                                  Width="120" ToolTip="Check SecurityTable are the same. SecurityTable may change depending on the order the entity was created." />
                                        <CheckBox Content="StagingTable"
                                                  Height="16"
                                                  HorizontalAlignment="Left"
                                                  IsChecked="{Binding cStates.StagingTable }"
                                                  Margin="4,68,0,0"
                                                  Name="cbxStagingTable"
                                                  VerticalAlignment="Top"
                                                  Width="120" />
                                    </Grid>
                                </GroupBox>
                                <GroupBox Header="Ignore Attribute"
                                          Height="100"
                                          HorizontalAlignment="Stretch"
                                          Margin="0,150,6,0"
                                          Name="groupBox1"
                                          VerticalAlignment="Top">
                                    <Grid>
                                        <CheckBox Content="MUID"
                                                  Height="16"
                                                  HorizontalAlignment="Left"
                                                  Margin="4,4,0,0"
                                                  Name="cbxCompareIgnoreAttMUID"
                                                  VerticalAlignment="Top"
                                                  Width="120"
                                                  IsChecked="{Binding cStates.AttributeMUID }" ToolTip="Check MUID are the same" />
                                        <CheckBox Content="EntityID"
                                                  Height="16"
                                                  HorizontalAlignment="Left"
                                                  Margin="4,20,0,0"
                                                  Name="cbxCompareIgnoreAttEntityID"
                                                  VerticalAlignment="Top"
                                                  Width="120"
                                                  IsChecked="{Binding cStates.AttributeEntityID }" ToolTip="Check EntityID are the same. EntityID may change depending on the order the entity was created." />
                                        <CheckBox Content="DomainEntityID"
                                                  Height="16"
                                                  HorizontalAlignment="Left"
                                                  Margin="4,36,0,0"
                                                  Name="cbxCompareIgnoreAttDomainEntityID"
                                                  VerticalAlignment="Top"
                                                  Width="120"
                                                  IsChecked="{Binding cStates.AttributeDomainEntityID }" ToolTip="Check DomainEntityID are the same. EntityID may change depending on the order the entity was created." />
                                        <CheckBox Content="TableColumn"
                                                  Height="16"
                                                  HorizontalAlignment="Left"
                                                  Margin="4,52,0,0"
                                                  Name="cbxCompareIgnoreAttTableColumn"
                                                  VerticalAlignment="Top"
                                                  Width="120"
                                                  IsChecked="{Binding cStates.AttributeTableColumn }" ToolTip="Check TableColumn are the same. TableColumn may change depending on the order the entity and attribute was created." />
                                    </Grid>
                                </GroupBox>
                                <GroupBox Header="Ignore Attribute Group"
                                          Height="50"
                                          HorizontalAlignment="Stretch"
                                          Margin="0,260,6,0"
                                          Name="groupAttributeGroup"
                                          VerticalAlignment="Top">
                                    <Grid>
                                        <CheckBox Content="MUID"
                                                  Height="16"
                                                  HorizontalAlignment="Left"
                                                  Margin="4,4,0,0"
                                                  Name="cbxCompareIgnoreAttGroupMUID"
                                                  VerticalAlignment="Top"
                                                  Width="120"
                                                  IsChecked="{Binding cStates.AttributeGroupMUID }" ToolTip="Check MUID are the same" />
                                    </Grid>
                                </GroupBox>

                            </Grid>
                            <GridSplitter Grid.Column="1"
                                          HorizontalAlignment="Stretch"
                                          VerticalAlignment="Stretch"
                                          Style="{StaticResource SliderStyle}" />
                            <Grid Grid.Column="2">
                                <TabControl>
                                    <TabItem Header="Data"
                                             Name="tbiCompareData">
                                        <Grid>
                                            <Grid.RowDefinitions>
                                                <RowDefinition />
                                                <RowDefinition Height="5" />
                                                <RowDefinition />
                                            </Grid.RowDefinitions>
                                            <Grid Grid.Row="0">
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition />
                                                    <ColumnDefinition Width="5" />
                                                    <ColumnDefinition Width="200" />
                                                </Grid.ColumnDefinitions>
                                                <Grid Grid.Column="0">

                                                    <DataGrid x:Name="dgDataMdsObject"
                                                              CanUserAddRows="False"
                                                              AutoGenerateColumns="False"
                                                              CanUserDeleteRows="False"
                                                              ItemsSource="{Binding}"
                                                              SelectionChanged="dgDataMdsObject_SelectionChanged"
                                                              IsReadOnly="False"
                                                              Margin="0,10,0,0">
                                                        <DataGrid.GroupStyle>
                                                            <GroupStyle ContainerStyle="{StaticResource GroupHeaderStyle}">
                                                                <GroupStyle.Panel>
                                                                    <ItemsPanelTemplate>
                                                                        <DataGridRowsPresenter />
                                                                    </ItemsPanelTemplate>
                                                                </GroupStyle.Panel>
                                                            </GroupStyle>
                                                        </DataGrid.GroupStyle>
                                                        <DataGrid.Columns>
                                                            <DataGridCheckBoxColumn Header=""
                                                                                    Binding="{Binding Checked}" />
                                                            <DataGridTextColumn Header="ObjectType"
                                                                                Binding="{Binding ObjectType}"
                                                                                IsReadOnly="True" />
                                                            <DataGridTextColumn Header="ObjectName"
                                                                                Binding="{Binding ObjectName}"
                                                                                IsReadOnly="True" />
                                                        </DataGrid.Columns>
                                                    </DataGrid>
                                                </Grid>
                                                <GridSplitter Grid.Column="1"
                                                              HorizontalAlignment="Stretch"
                                                              VerticalAlignment="Stretch"
                                                              Style="{StaticResource SliderStyle}" />
                                                <Grid Grid.Column="2">
                                                    <DataGrid x:Name="dgDataMdsObjectAttribute"
                                                              CanUserAddRows="False"
                                                              AutoGenerateColumns="True"
                                                              CanUserDeleteRows="False"
                                                              ItemsSource="{Binding}"
                                                              LoadingRow="dgDataAttribute_LoadingRow"
                                                              Margin="0,27,0,0"
                                                              IsReadOnly="True"></DataGrid>
                                                    <Label Content="Entity Details"
                                                           Height="28"
                                                           HorizontalAlignment="Left"
                                                           Margin="6,0,0,0"
                                                           Name="lblObjectAttributeDetails"
                                                           VerticalAlignment="Top" />
                                                </Grid>
                                            </Grid>
                                            <GridSplitter Grid.Row="1"
                                                          HorizontalAlignment="Stretch"
                                                          VerticalAlignment="Stretch"
                                                          Style="{StaticResource SliderStyle}" />
                                            <Grid Grid.Row="2">
                                                <TabControl  Name="tbcCompareSchemaAttributes"
                                                             Visibility="Visible">
                                                    <TabItem Header="Attributes"
                                                             Name="tbiCompareSchemaAttriubtes">
                                                        <Grid>
                                                            <Grid.ColumnDefinitions>
                                                                <ColumnDefinition />
                                                                <ColumnDefinition Width="5" />
                                                                <ColumnDefinition Width="200" />
                                                            </Grid.ColumnDefinitions>
                                                            <Grid Grid.Column="0">
                                                                <DataGrid x:Name="dgDataAttributes"
                                                                          CanUserAddRows="False"
                                                                          AutoGenerateColumns="False"
                                                                          CanUserDeleteRows="False"
                                                                          ItemsSource="{Binding}"
                                                                          SelectionChanged="dgDataAttributes_SelectionChanged"
                                                                          LoadingRow="dgDataAttributes_LoadingRow"
                                                                          Margin="0,25,0,2"
                                                                          BeginningEdit="dgDataAttributes_BeginningEdit">
                                                                    <DataGrid.Columns>
                                                                        <DataGridTemplateColumn>
                                                                            <DataGridTemplateColumn.HeaderTemplate>
                                                                                <DataTemplate x:Name="cbxdgDataAttributesAllTemplate">
                                                                                    <CheckBox Name="cbxDataAttributesAll"
                                                                                              Checked="dgDataAttributes_Header_CheckBox_Checked"
                                                                                              Unchecked="dgDataAttributes_Header_CheckBox_UnChecked"
                                                                                              Initialized="cbxDataAttributesAll_Initialized"
                                                                                              Margin="2,1,0,0" />
                                                                                </DataTemplate>
                                                                            </DataGridTemplateColumn.HeaderTemplate>
                                                                            <DataGridTemplateColumn.CellTemplate>
                                                                                <DataTemplate>
                                                                                    <CheckBox IsChecked="{Binding Path=Checked, UpdateSourceTrigger=PropertyChanged}"
                                                                                              Margin="4,1,0,0" />
                                                                                </DataTemplate>
                                                                            </DataGridTemplateColumn.CellTemplate>
                                                                            <DataGridTemplateColumn.CellStyle>
                                                                                <Style TargetType="{x:Type DataGridCell}">
                                                                                    <Setter Property="IsTabStop"
                                                                                            Value="False" />
                                                                                </Style>
                                                                            </DataGridTemplateColumn.CellStyle>
                                                                        </DataGridTemplateColumn>
                                                                        <DataGridTextColumn Header="AttributeNameA"
                                                                                            Binding="{Binding AttributeA.Name}"
                                                                                            IsReadOnly="True" />
                                                                        <DataGridTextColumn Header="Status"
                                                                                            Binding="{Binding Status}"
                                                                                            IsReadOnly="True" />
                                                                        <DataGridTextColumn Header="SortOrder"
                                                                                            Binding="{Binding SortOrder}"
                                                                                            IsReadOnly="True" />
                                                                        <DataGridTextColumn Header="AttributeNameB"
                                                                                            Binding="{Binding AttributeB.Name}"
                                                                                            IsReadOnly="True" />
                                                                    </DataGrid.Columns>
                                                                </DataGrid>
                                                                <Label Content="Attributes"
                                                                       Height="28"
                                                                       HorizontalAlignment="Left"
                                                                       Margin="6,0,0,0"
                                                                       Name="lblAttributes"
                                                                       VerticalAlignment="Top" />
                                                                <Button Content="Sort Order"
                                                                        Height="23"
                                                                        HorizontalAlignment="Right"
                                                                        Margin="0,2,6,0"
                                                                        Name="btnModelCompareAtttributeSortOrder"
                                                                        VerticalAlignment="Top"
                                                                        Width="75"
                                                                        Click="btnModelCompareAtttributeSortOrder_Click"
                                                                        Visibility="Visible" />
                                                                <Button Content="Delete"
                                                                        Height="23"
                                                                        HorizontalAlignment="Right"
                                                                        Margin="0,2,87,0"
                                                                        Name="btnModelCompareAtttributeDelete"
                                                                        VerticalAlignment="Top"
                                                                        Width="75"
                                                                        Click="btnModelCompareAtttributeDelete_Click"
                                                                        Visibility="Visible" />
                                                            </Grid>
                                                            <GridSplitter Grid.Column="1"
                                                                          HorizontalAlignment="Stretch"
                                                                          VerticalAlignment="Stretch"
                                                                          Style="{StaticResource SliderStyle}" />
                                                            <Grid Grid.Column="2">
                                                                <DataGrid x:Name="dgDataAttribute"
                                                                          CanUserAddRows="False"
                                                                          AutoGenerateColumns="True"
                                                                          CanUserDeleteRows="False"
                                                                          ItemsSource="{Binding}"
                                                                          LoadingRow="dgDataAttribute_LoadingRow"
                                                                          Margin="0,27,0,0"
                                                                          IsReadOnly="True"></DataGrid>
                                                                <Label Content="Attribute Details"
                                                                       Height="28"
                                                                       HorizontalAlignment="Left"
                                                                       Margin="6,0,0,0"
                                                                       Name="lblAttributeDetails"
                                                                       VerticalAlignment="Top" />
                                                            </Grid>
                                                        </Grid>
                                                    </TabItem>
                                                    <TabItem Header="Attribute Groups"
                                                             Name="tbiCompareSchemaAttriubteGroups"
                                                             Margin="-2,-3,-2,0">
                                                        <Grid>
                                                            <Grid.RowDefinitions>
                                                                <RowDefinition />
                                                                <RowDefinition Height="5" />
                                                                <RowDefinition />
                                                            </Grid.RowDefinitions>
                                                            <Grid Grid.Row="0">
                                                                <Grid.ColumnDefinitions>
                                                                    <ColumnDefinition />
                                                                    <ColumnDefinition Width="5" />
                                                                    <ColumnDefinition Width="200" />
                                                                </Grid.ColumnDefinitions>
                                                                <Grid Grid.Column="0">

                                                                    <DataGrid x:Name="dgDataAttributeGroups"
                                                                              CanUserAddRows="False"
                                                                              AutoGenerateColumns="False"
                                                                              CanUserDeleteRows="False"
                                                                              ItemsSource="{Binding}"
                                                                              SelectionChanged="dgDataAttributeGroups_SelectionChanged"
                                                                              LoadingRow="dgDataAttributeGroups_LoadingRow"
                                                                              Margin="0,28,0,-1">
                                                                        <DataGrid.Columns>
                                                                            <DataGridTemplateColumn>
                                                                                <DataGridTemplateColumn.HeaderTemplate>
                                                                                    <DataTemplate x:Name="cbxdgDataAttributeGroupsAllTemplate">
                                                                                        <CheckBox Name="cbxDataAttributeGroupsAll"
                                                                                                  Checked="dgDataAttributeGroups_Header_CheckBox_Checked"
                                                                                                  Unchecked="dgDataAttributeGroups_Header_CheckBox_UnChecked"
                                                                                                  Initialized="cbxDataAttributeGroupsAll_Initialized"
                                                                                                  Margin="2,1,0,0" />
                                                                                    </DataTemplate>
                                                                                </DataGridTemplateColumn.HeaderTemplate>
                                                                                <DataGridTemplateColumn.CellTemplate>
                                                                                    <DataTemplate>
                                                                                        <CheckBox IsChecked="{Binding Path=Checked, UpdateSourceTrigger=PropertyChanged}"
                                                                                                  Margin="4,1,0,0" />
                                                                                    </DataTemplate>
                                                                                </DataGridTemplateColumn.CellTemplate>
                                                                                <DataGridTemplateColumn.CellStyle>
                                                                                    <Style TargetType="{x:Type DataGridCell}">
                                                                                        <Setter Property="IsTabStop"
                                                                                                Value="False" />
                                                                                    </Style>
                                                                                </DataGridTemplateColumn.CellStyle>
                                                                            </DataGridTemplateColumn>
                                                                            <DataGridTextColumn Header="AttributeGroupNameA"
                                                                                                Binding="{Binding AttributeGroupA.Name}"
                                                                                                IsReadOnly="True" />
                                                                            <DataGridTextColumn Header="Status"
                                                                                                Binding="{Binding Status}"
                                                                                                IsReadOnly="True" />
                                                                            <DataGridTextColumn Header="SortOrder"
                                                                                                Binding="{Binding SortOrder}"
                                                                                                IsReadOnly="True" />
                                                                            <DataGridTextColumn Header="AttributeGroupNameB"
                                                                                                Binding="{Binding AttributeGroupB.Name}"
                                                                                                IsReadOnly="True" />
                                                                        </DataGrid.Columns>
                                                                    </DataGrid>
                                                                    <Label Content="Attribute Group"
                                                                           Height="28"
                                                                           HorizontalAlignment="Left"
                                                                           Margin="6,0,0,0"
                                                                           Name="lblAttributeGroup"
                                                                           VerticalAlignment="Top"
                                                                           Grid.ColumnSpan="2" />
                                                                    <Button Content="Sort Order"
                                                                            Height="23"
                                                                            HorizontalAlignment="Right"
                                                                            Margin="0,2,6,0"
                                                                            Name="btnModelCompareAtttributeGroupSortOrder"
                                                                            VerticalAlignment="Top"
                                                                            Width="75"
                                                                            Click="btnModelCompareAtttributeGroupSortOrder_Click"
                                                                            Visibility="Visible"
                                                                            Grid.Column="1" />
                                                                    <Button Content="Delete"
                                                                            Height="23"
                                                                            HorizontalAlignment="Right"
                                                                            Margin="0,2,87,0"
                                                                            Name="btnModelCompareAtttributeGroupDelete"
                                                                            VerticalAlignment="Top"
                                                                            Width="75"
                                                                            Click="btnModelCompareAtttributeGroupDelete_Click"
                                                                            Visibility="Visible"
                                                                            Grid.Column="1" />
                                                                </Grid>
                                                                <GridSplitter Grid.Column="1"
                                                                              HorizontalAlignment="Stretch"
                                                                              VerticalAlignment="Stretch"
                                                                              Style="{StaticResource SliderStyle}" />
                                                                <Grid Grid.Column="2">
                                                                    <DataGrid x:Name="dgDataAttributeGroupProperties"
                                                                              CanUserAddRows="False"
                                                                              AutoGenerateColumns="True"
                                                                              CanUserDeleteRows="False"
                                                                              ItemsSource="{Binding}"
                                                                              LoadingRow="dgDataAttributeGroupProperties_LoadingRow"
                                                                              Margin="0,27,0,0"
                                                                              IsReadOnly="True"></DataGrid>
                                                                    <Label Content="Attribute Group Properties"
                                                                           Height="28"
                                                                           HorizontalAlignment="Left"
                                                                           Margin="6,0,0,0"
                                                                           Name="lblAttributeGroupProperties"
                                                                           VerticalAlignment="Top" />
                                                                </Grid>
                                                            </Grid>
                                                            <GridSplitter Grid.Row="1"
                                                                          HorizontalAlignment="Stretch"
                                                                          VerticalAlignment="Stretch"
                                                                          Style="{StaticResource SliderStyle}" />
                                                            <Grid Grid.Row="2">
                                                                <Grid.ColumnDefinitions>
                                                                    <ColumnDefinition />
                                                                    <ColumnDefinition Width="5" />
                                                                    <ColumnDefinition Width="200" />
                                                                </Grid.ColumnDefinitions>
                                                                <Grid Grid.Column="0">
                                                                    <DataGrid x:Name="dgDataAttributeGroupDetails"
                                                                              CanUserAddRows="False"
                                                                              AutoGenerateColumns="False"
                                                                              CanUserDeleteRows="False"
                                                                              ItemsSource="{Binding}"
                                                                              SelectionChanged="dgDataAttributeGroupDetails_SelectionChanged"
                                                                              LoadingRow="dgDataAttributeGroupDetails_LoadingRow"
                                                                              Margin="0,27,0,0"
                                                                              Grid.ColumnSpan="2">
                                                                        <DataGrid.Columns>
                                                                            <DataGridTemplateColumn>
                                                                                <DataGridTemplateColumn.HeaderTemplate>
                                                                                    <DataTemplate x:Name="cbxdgDataAttributeGroupDetailsAllTemplate">
                                                                                        <CheckBox Name="cbxDataAttributeGroupDetailsAll"
                                                                                                  Checked="dgDataAttributeGroupDetails_Header_CheckBox_Checked"
                                                                                                  Unchecked="dgDataAttributeGroupDetails_Header_CheckBox_UnChecked"
                                                                                                  Initialized="cbxDataAttributeGroupDetailsAll_Initialized"
                                                                                                  Margin="2,1,0,0" />
                                                                                    </DataTemplate>
                                                                                </DataGridTemplateColumn.HeaderTemplate>
                                                                                <DataGridTemplateColumn.CellTemplate>
                                                                                    <DataTemplate>
                                                                                        <CheckBox IsChecked="{Binding Path=Checked, UpdateSourceTrigger=PropertyChanged}"
                                                                                                  Margin="4,1,0,0" />
                                                                                    </DataTemplate>
                                                                                </DataGridTemplateColumn.CellTemplate>
                                                                                <DataGridTemplateColumn.CellStyle>
                                                                                    <Style TargetType="{x:Type DataGridCell}">
                                                                                        <Setter Property="IsTabStop"
                                                                                                Value="False" />
                                                                                    </Style>
                                                                                </DataGridTemplateColumn.CellStyle>
                                                                            </DataGridTemplateColumn>
                                                                            <DataGridTextColumn Header="AttributeGroupNameDetailA"
                                                                                                Binding="{Binding AttributeGroupDetailA.Name}"
                                                                                                IsReadOnly="True" />
                                                                            <DataGridTextColumn Header="Status"
                                                                                                Binding="{Binding Status}"
                                                                                                IsReadOnly="True" />
                                                                            <DataGridTextColumn Header="SortOrder"
                                                                                                Binding="{Binding SortOrder}"
                                                                                                IsReadOnly="True" />
                                                                            <DataGridTextColumn Header="AttributeGroupNameDetailB"
                                                                                                Binding="{Binding AttributeGroupDetailB.Name}"
                                                                                                IsReadOnly="True" />
                                                                        </DataGrid.Columns>
                                                                    </DataGrid>
                                                                    <Label Content="Attribute Group Detail"
                                                                           Height="28"
                                                                           HorizontalAlignment="Left"
                                                                           Margin="6,0,0,0"
                                                                           Name="lblAttributeGroupDetail"
                                                                           VerticalAlignment="Top"
                                                                           Grid.ColumnSpan="2" />
                                                                    <Button Content="Sort Order"
                                                                            Height="23"
                                                                            HorizontalAlignment="Right"
                                                                            Margin="0,2,6,0"
                                                                            Name="btnModelCompareAtttributeGroupDetailSortOrder"
                                                                            VerticalAlignment="Top"
                                                                            Width="75"
                                                                            Click="btnModelCompareAtttributeGroupDetailSortOrder_Click"
                                                                            Visibility="Visible"
                                                                            Grid.Column="1" />
                                                                    <Button Content="Delete"
                                                                            Height="23"
                                                                            HorizontalAlignment="Right"
                                                                            Margin="0,2,87,0"
                                                                            Name="btnModelCompareAtttributeGroupDetailDelete"
                                                                            VerticalAlignment="Top"
                                                                            Width="75"
                                                                            Click="btnModelCompareAtttributeGroupDetailDelete_Click"
                                                                            Visibility="Visible"
                                                                            Grid.Column="1" />
                                                                </Grid>
                                                                <GridSplitter Grid.Column="1"
                                                                              HorizontalAlignment="Stretch"
                                                                              VerticalAlignment="Stretch"
                                                                              Style="{StaticResource SliderStyle}" />
                                                                <Grid Grid.Column="2">
                                                                    <DataGrid x:Name="dgDataAttributeGroupDetailProperties"
                                                                              CanUserAddRows="False"
                                                                              AutoGenerateColumns="True"
                                                                              CanUserDeleteRows="False"
                                                                              ItemsSource="{Binding}"
                                                                              LoadingRow="dgDataAttributeGroupDetailProperties_LoadingRow"
                                                                              Margin="0,27,0,0"
                                                                              IsReadOnly="True"></DataGrid>
                                                                    <Label Content="Attribute Group Detail Properties"
                                                                           Height="28"
                                                                           HorizontalAlignment="Left"
                                                                           Margin="6,0,0,0"
                                                                           Name="lblAttributeGroupDetailProperties"
                                                                           VerticalAlignment="Top" />
                                                                </Grid>
                                                            </Grid>
                                                        </Grid>

                                                    </TabItem>
                                                </TabControl>
                                            </Grid>
                                        </Grid>
                                    </TabItem>
                                    <TabItem Header="ServerA"
                                             Name="tbiCompareServerA">
                                        <DataGrid x:Name="dgServerA"
                                                  AutoGenerateColumns="True"
                                                  CanUserDeleteRows="False"
                                                  ItemsSource="{Binding}"></DataGrid>
                                    </TabItem>
                                    <TabItem Header="ServerB"
                                             Name="tbiCompareServerB">
                                        <DataGrid x:Name="dgServerB"
                                                  AutoGenerateColumns="True"
                                                  CanUserDeleteRows="False"
                                                  ItemsSource="{Binding}"></DataGrid>
                                    </TabItem>
                                </TabControl>
                            </Grid>
                        </Grid>


                    </Grid>
                </TabItem>
                <TabItem Header="Model Data Compare"
                         Name="tbiModelDataCompare">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="50" />
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <Grid Grid.Row="0">
                            <Grid Margin="0,0,6,0">
                                <Button Content="Connect"
                                        Height="23"
                                        HorizontalAlignment="Left"
                                        Margin="6,6,0,0"
                                        Name="btnDCConnect"
                                        VerticalAlignment="Top"
                                        Width="55"
                                        Click="btnConnect_Click" />
                                <Button Content="Refresh"
                                        Height="23"
                                        Margin="66,6,0,0"
                                        Name="btnDCDataHelperRefresh"
                                        VerticalAlignment="Top"
                                        Click="btnDCDataHelperRefresh_Click"
                                        IsEnabled="False"
                                        HorizontalAlignment="Left"
                                        Width="75" />
                                <Button Content="Deploy"
                                        Height="23"
                                        HorizontalAlignment="Left"
                                        IsEnabled="False"
                                        Margin="150,6,0,0"
                                        Name="btnDCDataHelperDeploy"
                                        VerticalAlignment="Top"
                                        Width="75"
                                        Click="btnDCDataHelperDeploy_Click" />
                                <CheckBox Margin="0,33,0,0"
                                          Name="cbxCompareDataCaseSensitive"
                                          Content="Case Sensitive"
                                          IsChecked="{Binding cStates.CompareDataCaseSensitive }"
                                          Height="16"
                                          Width="105"
                                          VerticalAlignment="Top"
                                          HorizontalAlignment="Left" />
                                <CheckBox Margin="113,33,0,0"
                                          Name="cbxComparePushAllCodeName"
                                          Content="Push All Code Name"
                                          IsChecked="{Binding cStates.ComparePushAllCodeName }"
                                          Height="16"
                                          Width="136"
                                          VerticalAlignment="Top"
                                          HorizontalAlignment="Left" ToolTip="Push only code and name for all entities." />
                                <CheckBox Margin="250,33,0,0"
                                          Name="cbxCompareAutoPopulate"
                                          Content="Auto Populate"
                                          IsChecked="{Binding cStates.CompareAutoPopulate }"
                                          Height="16"
                                          Width="136"
                                          VerticalAlignment="Top"
                                          HorizontalAlignment="Left" ToolTip="Retrieve data for all entities" />
                                <Grid  Margin="261,0,6,0">
                                    <Label Content="Server A"
                                           Height="28"
                                           Margin="0,0,111,0"
                                           HorizontalAlignment="Left"
                                           Name="lblDCServerA"
                                           VerticalAlignment="Top" />
                                    <Label Content="Server B"
                                           Height="28"
                                           Margin="180,0,111,0"
                                           Name="lblDCServerB"
                                           VerticalAlignment="Top" />
                                    <TextBlock Name="tbDCServerA"
                                               Margin="239,0,6,22" />
                                    <TextBlock Margin="239,22,6,0"
                                               Name="tbDCServerB" />
                                    <Image Height="32"
                                           HorizontalAlignment="Left"
                                           Margin="60,6,0,0"
                                           Name="imgDCServerA"
                                           Stretch="UniformToFill"
                                           VerticalAlignment="Top"
                                           Width="30" />
                                    <Image Height="32"
                                           HorizontalAlignment="Left"
                                           Margin="100,6,0,0"
                                           Name="imgDCDirection"
                                           Stretch="UniformToFill"
                                           VerticalAlignment="Top"
                                           Width="32"
                                           MouseLeftButtonUp="imgDirection_MouseLeftButtonUp" />
                                    <Image Height="32"
                                           Margin="140,6,0,0"
                                           Name="imgDCServerB"
                                           Stretch="UniformToFill"
                                           VerticalAlignment="Top"
                                           HorizontalAlignment="Left"
                                           Width="30" />
                                </Grid>
                            </Grid>

                        </Grid>
                        <Grid Grid.Row="1">
                            <TabControl>
                                <TabItem Header="Main"
                                         Name="tbiModelDataCompareMain">
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="100" />
                                            <RowDefinition Height="5" />
                                            <RowDefinition Height="*" />
                                        </Grid.RowDefinitions>
                                        <Grid Grid.Row="0">
                                            <DataGrid Name="dgDataCompareEntities"
                                                      SelectionChanged="dgDataCompareEntities_SelectionChanged"
                                                      CanUserReorderColumns="False"
                                                      CanUserResizeRows="False"
                                                      CanUserSortColumns="True"
                                                      IsReadOnly="True"></DataGrid>

                                        </Grid>
                                        <GridSplitter Grid.Row="1"
                                                      Height="5"
                                                      HorizontalAlignment="Stretch" />
                                        <Grid Grid.Row="2">
                                            <ComboBox Height="23"
                                                      HorizontalAlignment="Left"
                                                      Margin="3,3,0,0"
                                                      Name="cbxMDCViewType"
                                                      VerticalAlignment="Top"
                                                      Width="120"
                                                      SelectionChanged="cbxMDCViewType_SelectionChanged">
                                                <ComboBoxItem Content="All"
                                                              IsSelected="True" />
                                                <ComboBoxItem Content="Same" />
                                                <ComboBoxItem Content="Different" />
                                            </ComboBox>


                                            <Grid Margin="0,30,0,0"
                                                  VerticalAlignment="Stretch"
                                                  HorizontalAlignment="Stretch">

                                                <Grid Margin="0,0,58,6"
                                                      VerticalAlignment="Stretch">
                                                    <ScrollViewer VerticalScrollBarVisibility="Disabled"
                                                                  HorizontalScrollBarVisibility="Auto">
                                                        <Grid Name="gPanel"
                                                              VerticalAlignment="Stretch">

                                                        </Grid>
                                                    </ScrollViewer>
                                                </Grid>
                                                <Grid  HorizontalAlignment="Right"
                                                       Width="19"
                                                       Margin="0,0,33,6">
                                                    <Grid.RowDefinitions>
                                                        <RowDefinition Height="26" />
                                                        <RowDefinition Height="*" />
                                                    </Grid.RowDefinitions>
                                                    <Grid Grid.Row="0" />
                                                    <Grid Grid.Row="1">
                                                        <DataGrid HeadersVisibility="Column"
                                                                  AutoGenerateColumns="False"
                                                                  HorizontalAlignment="Stretch"
                                                                  VerticalAlignment="Stretch"
                                                                  Name="dgScroller"
                                                                  CanUserAddRows="False"
                                                                  CanUserDeleteRows="False"
                                                                  CanUserReorderColumns="False"
                                                                  CanUserResizeRows="False"
                                                                  CanUserSortColumns="False"
                                                                  Grid.ColumnSpan="2"
                                                                  ScrollViewer.HorizontalScrollBarVisibility="Hidden"
                                                                  ScrollViewer.ScrollChanged="dgScroller_ScrollChanged">
                                                            <DataGrid.Resources>
                                                                <Style TargetType="ScrollViewer">
                                                                    <Setter Property="local:ScrollSynchronizer.ScrollGroup"
                                                                            Value="Group1" />
                                                                </Style>
                                                            </DataGrid.Resources>
                                                            <DataGrid.Columns>
                                                                <DataGridTextColumn Header="Code"
                                                                                    Binding="{Binding Code}"
                                                                                    Width="*"
                                                                                    x:Name="dgtcCode">
                                                                </DataGridTextColumn>
                                                            </DataGrid.Columns>
                                                        </DataGrid>
                                                    </Grid>
                                                </Grid>
                                            </Grid>
                                        </Grid>
                                    </Grid>
                                </TabItem>
                                <TabItem Header="Data"
                                         Name="tbiModelDataCompareData">
                                    <DataGrid AutoGenerateColumns="True"
                                              Name="dgDataCompHelper" />
                                </TabItem>
                            </TabControl>
                        </Grid>
                    </Grid>
                </TabItem>
                <TabItem Header="Edit"
                         Name="tbiAdmin"
                         Visibility="Visible">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition  Height="60" />
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <Grid Grid.Row="0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="145*" />
                                <ColumnDefinition Width="19*" />
                                <ColumnDefinition Width="227*" />
                            </Grid.ColumnDefinitions>
                            <ComboBox Height="23"
                                      HorizontalAlignment="Left"
                                      Margin="83,32,0,0"
                                      Name="cbxService"
                                      VerticalAlignment="Top"
                                      Width="441"
                                      Grid.ColumnSpan="3" />
                            <Button Content="Connect"
                                    Height="23"
                                    HorizontalAlignment="Left"
                                    Margin="202,32,0,0"
                                    Name="btnEditConnect"
                                    VerticalAlignment="Top"
                                    Width="75"
                                    Grid.Column="2" />
                            <Label Content="Service"
                                   Height="28"
                                   HorizontalAlignment="Left"
                                   Margin="39,31,0,0"
                                   Name="label1"
                                   VerticalAlignment="Top" />
                            <Label Content="Not Complete Still Needs Some Work"
                                   Height="28"
                                   HorizontalAlignment="Left"
                                   Margin="0,6,0,0"
                                   Name="label2"
                                   VerticalAlignment="Top" />
                        </Grid>
                        <Grid  Grid.Row="1">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition />
                                <ColumnDefinition Width="5" />
                                <ColumnDefinition />
                                <ColumnDefinition Width="5" />
                                <ColumnDefinition />
                            </Grid.ColumnDefinitions>
                            <Grid Grid.Column="0">
                                <TreeView HorizontalAlignment="Stretch"
                                          Name="trvModel"
                                          VerticalAlignment="Stretch"
                                          ItemsSource="{Binding}" />
                            </Grid>
                            <GridSplitter Grid.Column="1"
                                          HorizontalAlignment="Stretch"
                                          VerticalAlignment="Stretch"
                                          Style="{StaticResource SliderStyle}" />
                            <Grid Grid.Column="2">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition />
                                        <RowDefinition Height="5" />
                                        <RowDefinition />
                                    </Grid.RowDefinitions>
                                    <Grid Grid.Row="0">
                                        <wpg:PropertyGrid AutomaticlyExpandObjects="False"
                                                          Foreground="White"
                                                          Name="pgDetails"
                                                          ShowDescription="False"
                                                          ShowPreview="True"
                                                          HorizontalAlignment="Stretch"
                                                          VerticalAlignment="Stretch" />
                                    </Grid>
                                    <GridSplitter Grid.Row="1"
                                                  HorizontalAlignment="Stretch"
                                                  VerticalAlignment="Stretch"
                                                  Style="{StaticResource SliderStyle}" />
                                    <Grid Grid.Row="2">
                                        <Button Content="Button"
                                                Height="23"
                                                HorizontalAlignment="Left"
                                                Margin="6,6,0,0"
                                                Name="button1"
                                                VerticalAlignment="Top"
                                                Width="75" />
                                        <DataGrid AutoGenerateColumns="True"
                                                  HorizontalAlignment="Stretch"
                                                  Margin="6,35,0,0"
                                                  Name="dgEdit"
                                                  VerticalAlignment="Stretch" />
                                    </Grid>
                                </Grid>

                            </Grid>
                            <GridSplitter Grid.Column="3"
                                          HorizontalAlignment="Stretch"
                                          VerticalAlignment="Stretch"
                                          Style="{StaticResource SliderStyle}" />
                            <Grid Grid.Column="4">
                                <TabControl>
                                    <TabItem Header="Details"
                                             Name="tbiEdit">
                                        <Grid>
                                            <StackPanel HorizontalAlignment="Stretch"
                                                        Name="splFields"
                                                        VerticalAlignment="Stretch"
                                                        Height="304"
                                                        Margin="0,30,0,40" />
                                            <Button Content="OK"
                                                    Height="23"
                                                    HorizontalAlignment="Left"
                                                    Margin="29,345,0,0"
                                                    Name="btnOk"
                                                    VerticalAlignment="Top"
                                                    Width="75"
                                                    Click="btnOk_Click" />
                                            <Button Content="Cancel"
                                                    Height="23"
                                                    HorizontalAlignment="Right"
                                                    Margin="0,345,6,0"
                                                    Name="btnCancel"
                                                    VerticalAlignment="Top"
                                                    Width="75"
                                                    Click="btnCancel_Click" />
                                            <Button Height="23"
                                                    HorizontalAlignment="Left"
                                                    Margin="140,3,0,0"
                                                    Name="btnAdd"
                                                    VerticalAlignment="Top"
                                                    Width="24"
                                                    Click="btnAdd_Click">
                                                <Image Source="/MDSAdministration;component/Images/add_small_off.jpg" />
                                            </Button>
                                            <Button Height="23"
                                                    HorizontalAlignment="Left"
                                                    Margin="170,3,0,0"
                                                    Name="btnDelete"
                                                    VerticalAlignment="Top"
                                                    Width="24"
                                                    Click="btnDelete_Click">
                                                <Image Source="/MDSAdministration;component/Images/delete_small_off.jpg" />
                                            </Button>
                                        </Grid>
                                    </TabItem>
                                    <TabItem Header="Build"
                                             Name="tbiBuild">
                                        <Grid>
                                            <Grid>
                                                <Button Content="Build"
                                                        Height="23"
                                                        HorizontalAlignment="Left"
                                                        Margin="6,6,0,0"
                                                        Name="btnCodeBuild"
                                                        VerticalAlignment="Top"
                                                        Width="75"
                                                        Click="btnCodeBuild_Click" />
                                            </Grid>
                                            <Grid HorizontalAlignment="Stretch"
                                                  VerticalAlignment="Stretch"
                                                  Margin="0,35,0,0">
                                                <ScrollViewer>
                                                    <TextBox HorizontalAlignment="Stretch"
                                                             Name="txbCodeView"
                                                             Text=""
                                                             VerticalAlignment="Stretch" />
                                                </ScrollViewer>

                                            </Grid>
                                        </Grid>
                                    </TabItem>
                                </TabControl>
                            </Grid>
                        </Grid>
                    </Grid>
                </TabItem>
                <TabItem Header="Excel Upload"
                         Name="tbiExcelUpload">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="50" />
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <Grid Grid.Row="0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="108*" />
                                <ColumnDefinition Width="283*" />
                            </Grid.ColumnDefinitions>
                            <Button Content="Connect"
                                    Height="23"
                                    HorizontalAlignment="Left"
                                    Margin="6,6,0,0"
                                    Name="btnExcelUploadConnect"
                                    VerticalAlignment="Top"
                                    Width="55"
                                    Click="btnConnect_Click" />
                            <Grid Margin="45,0,6,0"
                                  Grid.Column="1">
                                <Label Content="Server A"
                                       Height="28"
                                       Margin="0,0,111,0"
                                       HorizontalAlignment="Left"
                                       VerticalAlignment="Top" />
                                <Label Content="Server B"
                                       Height="28"
                                       Margin="180,0,111,0"
                                       VerticalAlignment="Top" />
                                <TextBlock Name="tbExcelUploadServerA"
                                           Margin="239,0,6,22" />
                                <TextBlock Margin="239,22,6,0"
                                           Name="tbExcelUploadServerB" />
                                <Image Height="32"
                                       HorizontalAlignment="Left"
                                       Margin="60,6,0,0"
                                       Name="imgExcelUploadServerA"
                                       Stretch="UniformToFill"
                                       VerticalAlignment="Top"
                                       Width="30" />
                                <Image Height="32"
                                       HorizontalAlignment="Left"
                                       Margin="100,6,0,0"
                                       Name="imgExcelUploadDirection"
                                       Stretch="UniformToFill"
                                       VerticalAlignment="Top"
                                       Width="32"
                                       MouseLeftButtonUp="imgDirection_MouseLeftButtonUp" />
                                <Image Height="32"
                                       Margin="140,6,0,0"
                                       Name="imgExcelUploadServerB"
                                       Stretch="UniformToFill"
                                       VerticalAlignment="Top"
                                       HorizontalAlignment="Left"
                                       Width="30" />
                            </Grid>
                            <Button Content="Deploy"
                                    Height="23"
                                    HorizontalAlignment="Left"
                                    IsEnabled="False"
                                    Margin="76,6,0,0"
                                    Name="btnExcelUploadDataHelperDeploy"
                                    VerticalAlignment="Top"
                                    Width="75"
                                    Click="btnDataHelperDeploy_Click" />
                        </Grid>
                        <Grid Grid.Row="1">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="118" />
                                    <ColumnDefinition Width="5" />
                                    <ColumnDefinition />
                                </Grid.ColumnDefinitions>
                                <Grid Grid.Column="0">
                                    <GroupBox Header="Ignore"
                                              HorizontalAlignment="Left"
                                              Margin="0,0,0,0"
                                              VerticalAlignment="Top"
                                              Height="70"
                                              Width="115">
                                        <Grid>
                                            <CheckBox x:Name="cbxExcelUploadCheckCode"
                                                      Height="20"
                                                      Content="Check Code"
                                                      Margin="0,10,0,0"
                                                      VerticalAlignment="Top" ToolTip="Check that the code column exists in the excel spreadsheet" />
                                            <CheckBox x:Name="cbxExcelUploadCheckName"
                                                      Height="20"
                                                      Content="Check Name"
                                                      Margin="0,30,0,0"
                                                      IsChecked="True"
                                                      VerticalAlignment="Top" ToolTip="Check that the name column exists in the excel spreadsheet" />
                                        </Grid>
                                    </GroupBox>
                                    <GroupBox Header="Options"
                                              HorizontalAlignment="Left"
                                              Margin="0,98,0,0"
                                              VerticalAlignment="Top"
                                              Height="50"
                                              Width="115">
                                        <Grid>
                                            <CheckBox x:Name="cbxExcelUploadTrim"
                                                      Height="20"
                                                      Content="Trim"
                                                      Margin="0,4,10,4"
                                                      IsChecked="True" ToolTip="Removes all leading and trailing white-space characters from each cell" />
                                        </Grid>
                                    </GroupBox>
                                    <GroupBox Header="Advanced"
                                              HorizontalAlignment="Left"
                                              Margin="0,150,0,0"
                                              VerticalAlignment="Top"
                                              Height="80"
                                              Width="115">
                                        <Grid>
                                            <CheckBox x:Name="cbxExcelUploadAdvancedDeleteRaw"
                                                      Height="20"
                                                      Content="Delete Raw"
                                                      Margin="0,4,0,0"
                                                      IsChecked="True"
                                                      VerticalAlignment="Top" ToolTip="Delete all data from Raw table before load" />
                                            <CheckBox x:Name="cbxExcelUploadAdvancedDeleteBKMappig"
                                                      Height="20"
                                                      Content="Delete Mapping"
                                                      Margin="0,24,0,0"
                                                      IsChecked="True"
                                                      VerticalAlignment="Top" ToolTip="Delete all BK to Mapping data before load" />
                                        </Grid>
                                    </GroupBox>
                                </Grid>
                                <GridSplitter Grid.Column="1"
                                              HorizontalAlignment="Stretch"
                                              VerticalAlignment="Stretch"
                                              Style="{StaticResource SliderStyle}" />
                                <Grid Grid.Column="2">
                                    <TabControl>
                                        <TabItem Header="Simple">
                                            <Grid>

                                                <Button x:Name="btnExcelUploadSimOpen"
                                                        Content="..."
                                                        Margin="0,34,154,0"
                                                        VerticalAlignment="Top"
                                                        Click="btnExcelUploadSimOpen_Click"
                                                        RenderTransformOrigin="-0.56,0.478"
                                                        HorizontalAlignment="Right"
                                                        Width="25" />
                                                <Label Content="Excel"
                                                       HorizontalAlignment="Left"
                                                       Margin="10,31,0,0"
                                                       VerticalAlignment="Top" />
                                                <TextBox x:Name="txtExcelUploadSimFile"
                                                         Height="23"
                                                         Margin="53,34,184,0"
                                                         TextWrapping="Wrap"
                                                         VerticalAlignment="Top" IsReadOnly="True" />
                                                <ComboBox x:Name="cbxExcelUploadSimSheets"
                                                          HorizontalAlignment="Left"
                                                          Margin="53,62,0,0"
                                                          VerticalAlignment="Top"
                                                          Width="253"
                                                          SelectionChanged="cbxExcelUploadSimSheets_SelectionChanged" />
                                                <Label Content="Sheets"
                                                       HorizontalAlignment="Left"
                                                       Margin="10,62,0,0"
                                                       VerticalAlignment="Top"
                                                       RenderTransformOrigin="0.5,1.923" />
                                                <CheckBox x:Name="cbxExcelUploadSimShowFlags" Content="Show MDS Admin Flags"
                                                          HorizontalAlignment="Left"
                                                       Margin="55,9,0,0"
                                                       VerticalAlignment="Top" Checked="cbxExcelUploadSimShowFlags_Checked" Unchecked="cbxExcelUploadSimShowFlags_Unchecked" ToolTip="Show Validation Flags to help identify issuess when you export to excel."/>
                                                <DataGrid x:Name="dgExcelUploadSimSheet"
                                                          HorizontalAlignment="Stretch"
                                                          EnableColumnVirtualization="true"
                                                          EnableRowVirtualization="true"
                                                          VirtualizingStackPanel.IsVirtualizing="False"
                                                          VerticalAlignment="Stretch"
                                                          Margin="0,94,0,0"
                                                          IsReadOnly="True"
                                                          AutoGeneratingColumn="dgExcelUploadSimSheet_AutoGeneratingColumn">
                                                    <DataGrid.ColumnHeaderStyle>
                                                        <Style TargetType="{x:Type DataGridColumnHeader}">
                                                            <Setter Property="Background">
                                                                <Setter.Value>
                                                                    <MultiBinding Converter="{StaticResource colourHighlighterHeaderConverter}">
                                                                        <Binding RelativeSource="{RelativeSource Self}" />
                                                                        <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type DataGrid}}" />
                                                                        <Binding Path="CurrentModel"
                                                                                 Source="{StaticResource resourceWrapper}" />
                                                                    </MultiBinding>
                                                                </Setter.Value>
                                                            </Setter>
                                                            <Setter Property="ToolTip">
                                                                <Setter.Value>
                                                                    <MultiBinding Converter="{StaticResource toolTipHeaderConverter}">
                                                                        <MultiBinding.Bindings>
                                                                            <Binding RelativeSource="{RelativeSource Self}" />
                                                                            <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type DataGrid}}" />
                                                                            <Binding Path="CurrentModel"
                                                                                     Source="{StaticResource resourceWrapper}" />
                                                                        </MultiBinding.Bindings>
                                                                    </MultiBinding>
                                                                </Setter.Value>
                                                            </Setter>
                                                        </Style>
                                                    </DataGrid.ColumnHeaderStyle>
                                                    <DataGrid.CellStyle>
                                                        <Style TargetType="{x:Type DataGridCell}">
                                                            <Setter Property="Background">
                                                                <Setter.Value>
                                                                    <MultiBinding Converter="{StaticResource colourHighlighterCellConverter}">
                                                                        <MultiBinding.Bindings>
                                                                            <Binding RelativeSource="{RelativeSource Self}" />
                                                                            <Binding Path="Row" />
                                                                        </MultiBinding.Bindings>
                                                                    </MultiBinding>
                                                                </Setter.Value>
                                                            </Setter>
                                                            <Setter Property="ToolTip">
                                                                <Setter.Value>
                                                                    <MultiBinding Converter="{StaticResource toolTipCellConverter}">
                                                                        <MultiBinding.Bindings>
                                                                            <Binding RelativeSource="{RelativeSource Self}"></Binding>
                                                                            <Binding Path="Row"></Binding>
                                                                        </MultiBinding.Bindings>
                                                                    </MultiBinding>
                                                                </Setter.Value>
                                                            </Setter>
                                                            <Style.Triggers>
                                                                <Trigger Property="IsSelected"
                                                                         Value="True">
                                                                    <Setter Property="Background"
                                                                            Value="#FF319aff" />
                                                                    <Setter Property="Foreground"
                                                                            Value="White" />
                                                                </Trigger>
                                                            </Style.Triggers>
                                                        </Style>
                                                    </DataGrid.CellStyle>
                                                </DataGrid>

                                                <Button x:Name="btnExcelUploadSimrefresh"
                                                        Content="Refresh"
                                                        HorizontalAlignment="Left"
                                                        Margin="320,65,0,0"
                                                        VerticalAlignment="Top"
                                                        Width="75"
                                                        Click="btnExcelUploadSimrefresh_Click" />
                                                <Button x:Name="btnExcelUploadSimCheck"
                                                        Content="Check"
                                                        HorizontalAlignment="Left"
                                                        Margin="405,65,0,0"
                                                        VerticalAlignment="Top"
                                                        Width="75"
                                                        Click="btnExcelUploadSimCheck_Click" />
                                                <Button x:Name="btnExcelUploadSimPublish"
                                                        Content="Publish"
                                                        HorizontalAlignment="Left"
                                                        Margin="493,65,0,0"
                                                        VerticalAlignment="Top"
                                                        Width="75"
                                                        Click="btnExcelUploadSimPublish_Click" />
                                                <Button x:Name="btnExcelUploadSimExport"
                                                        Content="Export"
                                                        HorizontalAlignment="Left"
                                                        Margin="580,65,0,0"
                                                        VerticalAlignment="Top"
                                                        Width="75"
                                                        Click="btnExcelUploadSimExport_Click" />
                                            </Grid>
                                        </TabItem>

                                        <TabItem Header="Advanced">
                                            <Grid>
                                                <Grid.RowDefinitions>
                                                    <RowDefinition />
                                                    <RowDefinition Height="40" />
                                                </Grid.RowDefinitions>
                                                <Grid Grid.Row="0">
                                                    <TabControl x:Name="tbcExcelUploadAdv">
                                                        <TabItem x:Name="tbiExcelAdvLoadFile"
                                                                 Header="Load File">
                                                            <Grid>
                                                                <Grid>
                                                                    <Grid.RowDefinitions>
                                                                        <RowDefinition Height="70" />
                                                                        <RowDefinition />
                                                                        <RowDefinition Height="5" />
                                                                        <RowDefinition />
                                                                    </Grid.RowDefinitions>
                                                                    <Grid Grid.Row="0">
                                                                        <Button x:Name="btnExcelUploadAdvOpen"
                                                                                Content="..."
                                                                                Margin="0,6,74,0"
                                                                                VerticalAlignment="Top"
                                                                                Click="btnExcelUploadAdvOpen_Click"
                                                                                HorizontalAlignment="Right"
                                                                                Width="25" />
                                                                        <Label Content="Excel"
                                                                               HorizontalAlignment="Left"
                                                                               Margin="28,3,0,0"
                                                                               VerticalAlignment="Top" />
                                                                        <TextBox x:Name="txtExcelUploadAdvFile"
                                                                                 Height="23"
                                                                                 Margin="74,6,104,0"
                                                                                 TextWrapping="Wrap"
                                                                                 VerticalAlignment="Top" IsReadOnly="True" />
                                                                        <Label Content="Database"
                                                                               HorizontalAlignment="Left"
                                                                               Margin="10,35,0,0"
                                                                               VerticalAlignment="Top" />
                                                                        <TextBox x:Name="txtExcelUploadAdvDatabaseName"
                                                                                 Height="23"
                                                                                 Margin="74,35,0,0"
                                                                                 VerticalAlignment="Top"
                                                                                 HorizontalAlignment="Left"
                                                                                 Width="221" />
                                                                        <Label Content="Schema"
                                                                               HorizontalAlignment="Left"
                                                                               Margin="300,35,0,0"
                                                                               VerticalAlignment="Top" />
                                                                        <TextBox x:Name="txtExcelUploadAdvSchema"
                                                                                 Height="23"
                                                                                 Width="100"
                                                                                 Margin="350,35,0,0"
                                                                                 VerticalAlignment="Top"
                                                                                 Text="raw"
                                                                                 HorizontalAlignment="Left">

                                                                        </TextBox>
                                                                    </Grid>
                                                                    <Grid Grid.Row="1">
                                                                        <DataGrid x:Name="dgExcelUploadAdvLoadFiles"
                                                                                  Margin="0,0,0,0"
                                                                                  SelectionChanged="dgExcelUploadAdvLoadFiles_SelectionChanged"
                                                                                  CanUserAddRows="False"
                                                                                  CanUserDeleteRows="False"
                                                                                  CanUserReorderColumns="False"
                                                                                  CanUserResizeRows="False"
                                                                                  CanUserSortColumns="False"
                                                                                  AutoGenerateColumns="False">
                                                                            <DataGrid.Columns>
                                                                                <DataGridTemplateColumn>
                                                                                    <DataGridTemplateColumn.HeaderTemplate>
                                                                                        <DataTemplate x:Name="cbxdgExcelUploadAdvLoadFilesAllTemplate">
                                                                                            <CheckBox Name="cbxdgExcelUploadAdvLoadFilesAll"
                                                                                                      Checked="ExcelUploadAdvancedLoadFileColumnHeaderStyle_CheckBox_Checked"
                                                                                                      Unchecked="ExcelUploadAdvancedLoadFileColumnHeaderStyle_CheckBox_UnChecked"
                                                                                                      Margin="2,1,0,0" Initialized="cbxdgExcelUploadAdvLoadFilesAll_Initialized" />
                                                                                        </DataTemplate>
                                                                                    </DataGridTemplateColumn.HeaderTemplate>
                                                                                    <DataGridTemplateColumn.CellTemplate>
                                                                                        <DataTemplate>
                                                                                            <CheckBox IsChecked="{Binding Path=Load, UpdateSourceTrigger=PropertyChanged}"
                                                                                                      Margin="4,1,0,0" />
                                                                                        </DataTemplate>
                                                                                    </DataGridTemplateColumn.CellTemplate>
                                                                                    <DataGridTemplateColumn.CellStyle>
                                                                                        <Style TargetType="{x:Type DataGridCell}">
                                                                                            <Setter Property="IsTabStop"
                                                                                                    Value="False" />
                                                                                        </Style>
                                                                                    </DataGridTemplateColumn.CellStyle>
                                                                                </DataGridTemplateColumn>
                                                                                <DataGridTextColumn Header="Name"
                                                                                                    Binding="{Binding Name}"
                                                                                                    IsReadOnly="True" />
                                                                                <DataGridTextColumn Header="Count"
                                                                                                    Binding="{Binding Count}"
                                                                                                    IsReadOnly="True" />
                                                                            </DataGrid.Columns>


                                                                        </DataGrid>
                                                                    </Grid>
                                                                    <GridSplitter Grid.Row="2"
                                                                                  HorizontalAlignment="Stretch"
                                                                                  VerticalAlignment="Stretch"
                                                                                  Style="{StaticResource SliderStyle}" />
                                                                    <Grid Grid.Row="3">
                                                                        <DataGrid x:Name="dgExcelUploadAdvLoadFileData"
                                                                                  Margin="0,0,0,0"
                                                                                  CanUserReorderColumns="False"
                                                                                  CanUserResizeRows="False"
                                                                                  CanUserSortColumns="False" />
                                                                    </Grid>
                                                                </Grid>
                                                            </Grid>
                                                        </TabItem>
                                                        <TabItem x:Name="tbiExcelAdvTableMapping"
                                                                 Header="Table Mapping">
                                                            <Grid>
                                                                <Grid.ColumnDefinitions>
                                                                    <ColumnDefinition />
                                                                    <ColumnDefinition Width="5" />
                                                                    <ColumnDefinition Width="170" />
                                                                </Grid.ColumnDefinitions>
                                                                <Grid Grid.Column="0">
                                                                    <DataGrid x:Name="dgExcelUploadAdvTableMappings"
                                                                              Margin="0,0,0,0"
                                                                              SelectionChanged="dgExcelUploadAdvTableMappings_SelectionChanged"
                                                                              IsReadOnly="True"
                                                                              Grid.ColumnSpan="2"
                                                                              CanUserReorderColumns="False"
                                                                              CanUserResizeRows="False"
                                                                              CanUserSortColumns="False">
                                                                        <DataGrid.ContextMenu>
                                                                            <ContextMenu>
                                                                                <MenuItem x:Name="cmExcelUploadAdvTableMappingsCreateTable"
                                                                                          Header="Create Table"
                                                                                          Click="cmExcelUploadAdvTableMappingsCreateTable_Click" />
                                                                            </ContextMenu>
                                                                        </DataGrid.ContextMenu>
                                                                    </DataGrid>
                                                                </Grid>
                                                                <GridSplitter Grid.Column="1"
                                                                              HorizontalAlignment="Stretch"
                                                                              VerticalAlignment="Stretch"
                                                                              Style="{StaticResource SliderStyle}" />
                                                                <Grid Grid.Column="2">
                                                                    <DataGrid x:Name="dgExcelUploadAdvTableMappingsDifCol"
                                                                              Margin="0,0,0,0"
                                                                              IsReadOnly="True"
                                                                              CanUserReorderColumns="False"
                                                                              CanUserResizeRows="False"
                                                                              CanUserSortColumns="False" />
                                                                </Grid>
                                                            </Grid>
                                                        </TabItem>
                                                        <TabItem x:Name="tbiExcelAdvLoadMapping"
                                                                 Header="Data Mapping">
                                                            <Grid>
                                                                <Button x:Name="btnExcelUploadAdvOpenMapping"
                                                                        Content="..."
                                                                        VerticalAlignment="Top"
                                                                        Click="btnExcelUploadAdvOpenMapping_Click"
                                                                        HorizontalAlignment="Right"
                                                                        Width="45"
                                                                        Margin="0,9,26,0" />
                                                                <Label Content="Excel Mapping"
                                                                       HorizontalAlignment="Left"
                                                                       VerticalAlignment="Top"
                                                                       Margin="0,9,0,0" />
                                                                <TextBox x:Name="txtExcelUploadAdvMappingFile"
                                                                         Height="23"
                                                                         TextWrapping="Wrap"
                                                                         VerticalAlignment="Top"
                                                                         Margin="89,9,89,0" />
                                                                <ComboBox x:Name="cbxExcelUploadAdvMappingSheets"
                                                                          Margin="88,41,298,0"
                                                                          VerticalAlignment="Top"
                                                                          SelectionChanged="cbxExcelUploadAdvMappingSheets_SelectionChanged" />
                                                                <Label Content="Sheets"
                                                                       HorizontalAlignment="Left"
                                                                       Margin="45,41,0,0"
                                                                       VerticalAlignment="Top"
                                                                       RenderTransformOrigin="0.5,1.923" />
                                                                <Button x:Name="btnExcelUploadAdvMappingLoad"
                                                                        Content="Load"
                                                                        VerticalAlignment="Top"
                                                                        Click="btnExcelUploadAdvMappingLoad_Click"
                                                                        HorizontalAlignment="Right"
                                                                        Width="60"
                                                                        Margin="0,42,214,0" />

                                                                <DataGrid x:Name="dgExcelUploadAdvMapping"
                                                                          Margin="0,75,0,0"
                                                                          CanUserReorderColumns="False"
                                                                          CanUserResizeRows="False"
                                                                          CanUserSortColumns="False" />


                                                            </Grid>
                                                        </TabItem>
                                                        <TabItem x:Name="tbiExcelAdvDataCheck"
                                                                 Header="Data Check">
                                                            <Grid>
                                                                <Grid.RowDefinitions>
                                                                    <RowDefinition Height="70" />
                                                                    <RowDefinition />
                                                                </Grid.RowDefinitions>

                                                                <Grid Grid.Row="0">

                                                                    <TextBox x:Name="txtExcelUploadAdvDataCheckExecute"
                                                                             Height="23"
                                                                             VerticalAlignment="Top"
                                                                             Margin="66,37,95,0" />
                                                                    <Label Content="Execute"
                                                                           HorizontalAlignment="Left"
                                                                           Margin="10,36,0,0"
                                                                           VerticalAlignment="Top"
                                                                           Grid.ColumnSpan="2" />
                                                                    <Button x:Name="btnExcelUploadAdvDataCheckExecute"
                                                                            Content="Run"
                                                                            Margin="0,37,10,0"
                                                                            VerticalAlignment="Top"
                                                                            HorizontalAlignment="Right"
                                                                            Width="75"
                                                                            Grid.Column="1"
                                                                            Click="btnExcelUploadAdvDataCheckExecute_Click" />
                                                                    <CheckBox x:Name="cbxExcelUploadAdvDataCheckValidate"
                                                                              Content="Validate"
                                                                              HorizontalAlignment="Left"
                                                                              Margin="42,11,0,0"
                                                                              VerticalAlignment="Top"
                                                                              RenderTransformOrigin="0,0.625"
                                                                              IsChecked="True"
                                                                              Grid.Column="1"
                                                                              Checked="cbxExcelUploadAdvDataCheckValidate_Checked"
                                                                              Unchecked="cbxExcelUploadAdvDataCheckValidate_Unchecked" />
                                                                    <ComboBox x:Name="cbxExcelUploadAdvDataCheckRegion"
                                                                              HorizontalAlignment="Left"
                                                                              Margin="187,10,0,0"
                                                                              VerticalAlignment="Top"
                                                                              Width="218"
                                                                              Grid.Column="1"
                                                                              SelectionChanged="cbxExcelUploadAdvDataCheckRegion_SelectionChanged" />
                                                                    <Label Content="Region"
                                                                           HorizontalAlignment="Left"
                                                                           Margin="135,6,0,0"
                                                                           VerticalAlignment="Top"
                                                                           Grid.Column="1" />
                                                                </Grid>
                                                                <Grid Grid.Row="1">
                                                                    <Grid.ColumnDefinitions>
                                                                        <ColumnDefinition Width="150" />
                                                                        <ColumnDefinition Width="5" />
                                                                        <ColumnDefinition />
                                                                    </Grid.ColumnDefinitions>
                                                                    <Grid Grid.Column="0">
                                                                        <ListBox x:Name="lbxExcelUploadAdvancedDataCheck"
                                                                                 Margin="0,0,0,0"
                                                                                 SelectionChanged="lbxExcelUploadAdvancedDataCheck_SelectionChanged" />
                                                                    </Grid>
                                                                    <GridSplitter Grid.Column="1"
                                                                                  HorizontalAlignment="Stretch"
                                                                                  VerticalAlignment="Stretch"
                                                                                  Style="{StaticResource SliderStyle}" />
                                                                    <Grid Grid.Column="2">
                                                                        <DataGrid x:Name="dgExcelUploadAdvDataCheck"
                                                                                  Margin="0,0,0,0"
                                                                                  Grid.ColumnSpan="2"
                                                                                  CanUserReorderColumns="False"
                                                                                  CanUserResizeRows="False"
                                                                                  CanUserSortColumns="False" />

                                                                    </Grid>
                                                                </Grid>
                                                            </Grid>
                                                        </TabItem>
                                                        <TabItem x:Name="tbiExcelAdvReport"
                                                                 Header="Report">
                                                            <Grid>
                                                                <Grid.ColumnDefinitions>
                                                                    <ColumnDefinition Width="150" />
                                                                    <ColumnDefinition Width="5" />
                                                                    <ColumnDefinition />
                                                                </Grid.ColumnDefinitions>
                                                                <Grid Grid.Column="0">
                                                                    <ListBox x:Name="lbxExcelUploadAdvancedResults"
                                                                             Margin="0,0,0,0"
                                                                             SelectionChanged="lbxExcelUploadAdvancedResults_SelectionChanged" />
                                                                </Grid>
                                                                <GridSplitter Grid.Column="1"
                                                                              HorizontalAlignment="Stretch"
                                                                              VerticalAlignment="Stretch"
                                                                              Style="{StaticResource SliderStyle}" />
                                                                <Grid Grid.Column="2">

                                                                    <DataGrid x:Name="dgExcelUploadAdvReportData"
                                                                              Margin="0,0,0,40"
                                                                              Grid.ColumnSpan="2" />
                                                                    <Button x:Name="btnExcelUploadAdvReportExport"
                                                                            Content="Export"
                                                                            Margin="0,0,10,10"
                                                                            VerticalAlignment="Bottom"
                                                                            HorizontalAlignment="Right"
                                                                            Width="75"
                                                                            Click="btnExcelUploadAdvReportExport_Click"
                                                                            Grid.Column="1" />
                                                                </Grid>
                                                            </Grid>
                                                        </TabItem>


                                                    </TabControl>
                                                </Grid>
                                                <Grid Grid.Row="1">
                                                    <Button x:Name="btnExcelUploadAdvBack"
                                                            Content="Back"
                                                            HorizontalAlignment="Right"
                                                            Margin="0,10,181,0"
                                                            VerticalAlignment="Top"
                                                            Width="75"
                                                            Click="btnExcelUploadAdvBack_Click" />
                                                    <Button x:Name="btnExcelUploadAdvNext"
                                                            Content="Next"
                                                            HorizontalAlignment="Right"
                                                            Margin="0,10,97,0"
                                                            VerticalAlignment="Top"
                                                            Width="75"
                                                            Click="btnExcelUploadAdvNext_Click" />
                                                    <Button x:Name="btnExcelUploadAdvCancel"
                                                            Content="Cancel"
                                                            HorizontalAlignment="Right"
                                                            Margin="0,10,13,0"
                                                            VerticalAlignment="Top"
                                                            Width="75"
                                                            Click="btnExcelUploadAdvCancel_Click" />
                                                    <Button x:Name="btnExcelUploadAdvRefresh"
                                                            Content="Refresh"
                                                            HorizontalAlignment="Left"
                                                            Margin="10,10,0,0"
                                                            VerticalAlignment="Top"
                                                            Width="75"
                                                            Click="btnExcelUploadAdvRefresh_Click" />
                                                </Grid>
                                            </Grid>
                                        </TabItem>
                                    </TabControl>
                                </Grid>
                            </Grid>

                        </Grid>
                    </Grid>
                </TabItem>
            </TabControl>
        </Grid>
    </Grid>
</Window>
